import requests

from utils import RedisHelper

redis_client = RedisHelper().get_conn()
url = "https://api.gx.me/store/v3/mods/ueqxvd"
page_url= "https://api.gx.me/store/v3/mods?page=3&pageSize=50&sort=total-downloads-desc&tagAlias=desktop"
headers = {
   "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0",
}


def main(page):
   page_url = f"https://api.gx.me/store/v3/mods?page={page}&pageSize=50&sort=total-downloads-desc&tagAlias=desktop"
   res = requests.get(page_url, headers=headers)
   data_list = res.json()["data"]["mods"]
   for data in data_list:
      mod_id = data["modShortId"]